#!/bin/bash

IFS=$'\n'

directories=`ls unmerged | grep -v .csv`
here=`pwd`/unmerged
there=`pwd`/merged

rm $there/*

for directory in $directories ; do
	echo $directory
	name=$there/$directory.csv
	dname=$here/$directory
	echo $name
	echo $dname
	echo
	cat $dname/*.csv | egrep -v "^\"Title\",\"Publication number\",\"Publication date\"," >> $name
done

